﻿

--删除员工档案
CREATE proc [dbo].[proc_Employee_Delete]
(
	@id int
)
as
begin
	if(@id<>2556)
	BEGIN
		DECLARE @bo VARCHAR(20)
		SELECT @bo= Enumber FROM Employee WHERE id=@id
		IF(@bo='9')
		 BEGIN
	--员工表
	delete from Employee where id = @id
	--教育经历
	delete from Employee_EducationResume where eid=@id
	--工作经历
	delete from Employee_WorkExperience where eid=@id
	--入职审核表
	delete from Employee_Entry where eid=@id
	--转正申请/审批
	--delete from Employee_ProbationPassed where eid=@id
	--离职申请/审批
	delete from Employee_Dimission where eid=@id
	--职级岗位异动申请/审批
	--delete from Employee_PostMove where eid=@id
	--工作单位调动申请/审批
	--DELETE FROM Employee_CompanyMove WHERE Eid=@id    
	--删除帐号表
	--declare @username varchar(50)
	--set @username = (select username from employee where id=@id)
	--delete from aspnet_Users where username=@username
		 END
	END
end

